GE 423 Mechatronics

Final Project Summary

Meet team 6 (AKA Team Tortoise)

KArthik

Arunachalan

Andrew

schrock

Zonghe

Chua

Jon

Sullivan

First...Some Video

Meet the Robot

Objective

 

The purpose of our robot is travel to five points through a randomly generated course while avoiding obstacles and collecting orange and blue golf balls. Once the golf balls have been collected, each color is dropped in its respective chute.

 

General Navigation Algorithm

 

In order for our robot to complete the contest, our group used a mix of right and left wall following as our obstacle avoidance algorithm. We implemented a state machine to control what "mode" the robot was in.

 

In our the general waypoint movement state (state 1) we initially have conditionals that push the robot into blue ball or orange ball following mode if a certain distance from the ball is satisfied, a certain number of pixels is seen, and the robot’s position is within the course boundaries. We do not want the robot detecting balls beyond the boundary of this course, as this can make the ball drop process quite confusing and possibly detect students walking around.

 

In this waypoint movement state, if a certain front wall error threshold is passed, the robot then decides whether it should go into right or left wall follow mode. If the robot detects there are obstacles closer to the right side of it, then it will go into right wall follow mode (state 2).  Otherwise, it will go into left wall follow mode (state 3). If there are no interfering obstacles or golf balls nearby, the robot proceeds to go to its next specified coordinate.

 

Proportional control is employed to ensure the robot turns 90 degrees before entering wall following at which point two points on one side of the car are monitored to calculate the error between the desired distance away from the wall and the robots position. Two points on one side aimed slightly forward and backward allow the robot to tell when it has exited an external corner or if it should continue standard wall following mode. Again proportional control ensures relatively close proximity to the wall.

In the event that the robot goes into right wall follow mode, the robot will follow a right wall until it notices its next coordinate is to the left of the robot using coordinate transformations and Kalman filtered robot position data. The robot can also break from right wall follow mode if it notices a blue or orange golf ball (similar conditions as described in previous paragraph). Left wall follow mode is similar, however the robot will only break away if its next coordinate is to the right of the robot or if it notices a blue or orange golf ball.

 

Ball Pick-up Algorithm

 

In state 4, the robot enter blue ball follow mode. The robot will only break out of the mode if it senses something in front of it. If this is the case, then the robot will enter control state one. The robot turns, with a magnitude proportional to how far off the blue ball column centroid is from the center, and moves forward towards the ball. Once the ball is a 2.5 tiles from the robot, the shunt actuates in order to take the blue colored ball into the correct side of the gripper. Once the robot car is 2 tiles away, the gate opens, so that the robot can take the ball into the gripper.

 

During this time, the robot also records the coordinates of the blue golf ball using a coordinate transformation so that the coordinates of the ball can be read in global coordinates. Each golf ball’s coordinates is saved into variables that will later sent to LABVIEW. In order to tell the robot when to close its gate, the robot first finds the distance it is away from the golf ball. Once, this distance is identified, the robots displacement is tracked (using the encoders on the wheels). Once the displacement surpasses the distance the ball is from the robot, the gate is commanded to shut. To circumvent the situation where the robot sees multiple balls in range and keeps the gate open, a time out is called to close the gate. A similar delay is added to open the gate again when the robot is closer to the next ball in the chain.

 

The orange ball follow mode (state 5) has been programmed exactly as stated above, however the robot now uses the orange ball statistics rather than the blue ball statistics.

 

The ball drop off mode (state 6 and 7) is only called when the robot has to travel to its two final positions (the positions of the orange and blue ball chutes). Once the robot car drives to the blue chute, it actuates the shunt to the appropriate position and opens the gate. For the first second, the robot is in the blue chute, the robot freezes. For the next second it reverses slowly, so that the balls are released from the gripper. Once the balls have been released, the robot closes its gate and proceeds to go the orange chute. It performs a similar process as described above.

 

Color Vision Algorithm

 

A few adjustments were made to the Color Vision Algorithm in order to help our robot identify and pick up the orange and blue golf balls. Our robots main purpose is to continuously update the statistics between orange and blue alternately using a toggle variable so that the data could be interpreted in the user_final_project C file. The HSV range that characterizes the orange and blue golf balls was found while Optitrack was running (Optitrack can change the HSV values that orange and blue normal are represented by). If no orange and blue pixels were found, the amount of blue or orange pixels seen would be set to zero, and also object_y is set to some arbitrary value. This is so the distance function does not randomly generate values, as the robot cannot read the distance it is from the blue or orange golf ball once it get to close.

Labview interface

LabVIEW was used in our final project as a user interface to provide visual information about the location of the robot in the course as well as the location of the colored golf  balls as our robot found them.  A map of the course displayed the current position of the  robot and also displayed blue or orange golf balls on the course map. Instead of dynamically updating the number of balls and their position, we just hard coded 6 ball position variables into the VI.

 

We also added a couple of inputs to be able to tune certain parameters like the speed of the robot in the xycontrol function leading up to the  competition.  To accomplish these tasks, LabVIEW communicated to the robot through Linux by sending information (tunable parameters) and receiving information (location of robot and golf balls).  There is a function in the robot's C code to periodically check if new information is needed to be received or sent.

 

As a bonus, we tried to incorporate a button that would boot up new windows of putty and copy .bin files. However we could not figure out the exact way to do it.

 

 

Download our Labview Code Here

Download our Robot Code Here

Thank you Dan for a fun-filled semester full of great learning!